package com.admin.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import com.member.domain.MemberCommand;
import com.payment.domain.PaymentCommand;
import com.point.domain.PointCommand;

@Component
public class ApaymentDaoImpl extends SqlSessionDaoSupport implements ApaymentDao{
	@Override
	public List<PaymentCommand> list(Map<String, Object> map) {
		List<PaymentCommand> list = getSqlSession().selectList("adminPayment.selectList",map);
		return list;
	}

	@Override
	public void insertPayment(PaymentCommand payment) {
		getSqlSession().insert("adminPayment.insertPayment",payment);		
	}	
	
	@Override
	public int getRowCount(Map<String, Object> map) {
		return getSqlSession().selectOne("adminPayment.selectCount",map);
	}

	@Override
	public PaymentCommand selectPayment(Integer num) {
		return getSqlSession().selectOne("adminPayment.selectPayment",num);
	}

	@Override
	public void update(PaymentCommand paymentCommand) {
		getSqlSession().selectOne("adminPayment.updatePayment",paymentCommand);
	}

	@Override
	public void insertPoint(PointCommand point) {
		getSqlSession().insert("adminPayment.insertPoint",point);	
	}

	@Override
	public void memberPointUpdate(MemberCommand memberCommand) {
		getSqlSession().selectOne("adminPayment.updateMemberPoint",memberCommand);
		
	}
	
	@Override
	public int selectPointSum(PointCommand point) {
		return getSqlSession().selectOne("adminPayment.selectPointSum", point);
	}

	@Override
	public int selectTotalPoint() {
		return getSqlSession().selectOne("adminPayment.selectTotalPoint");
	}

	@Override
	public int getPointRowCount(Map<String, Object> map) {
		return getSqlSession().selectOne("adminPayment.selectPointCount",map);
	}

}
